<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function Person(name, age) {
      this.name = name
      this.age = age
    }

    Person.prototype.show = function () {
      console.log('Hello World')
    }

    function Star(name, age) {
      // 不能省略
    }

    Star.prototype = new Person('刘德华', 60)
    Star.prototype.constructor = Star;

    const ldh = new Star('刘德华', 60)
    const zxy = new Star('张雪有', 70)

    console.log(zxy.name)
    console.log(zxy.age)
    zxy.show()
  </script>
</body>

</html>